package ar.edu.unq.wannaplay.employee;

import java.io.Serializable;

public class Skill implements Serializable {

    private static final long serialVersionUID = 1L;

    private long id;

    private String knowledge;

    private Experience experience;

    public Skill() {
        super();
    }

    public Skill(final String aKnowledge, final Experience anExperience) {
        super();
        this.setKnowledge(aKnowledge);
        this.setExperience(anExperience);
    }

    private void setKnowledge(final String aKnowledge) {
        knowledge = aKnowledge;
    }

    private void setExperience(final Experience anExperience) {
        experience = anExperience;
    }

    public String getKnowledge() {
        return knowledge;
    }

    public Experience getExperience() {
        return experience;
    }

    @Override
    public int hashCode() {
        int prime = 31;
        int result = 1;
        result = prime * result + (experience == null ? 0 : experience.hashCode());
        result = prime * result + (knowledge == null ? 0 : knowledge.hashCode());
        return result;
    }

    @Override
    // NOPMD
    public boolean equals(final Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (this.getClass() != obj.getClass()) {
            return false;
        }
        Skill other = (Skill) obj;
        if (experience != other.experience) {
            return false;
        }
        if (knowledge == null) {
            if (other.knowledge != null) {
                return false;
            }
        } else if (!knowledge.equals(other.knowledge)) {
            return false;
        }
        return true;
    }

    public long getId() {
        return id;
    }

    public void setId(final long id) {
        this.id = id;
    }

}
